#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include "ui_mainwindow.h"

#include "shogiclient.h"
#include "shogidef.h"
#include "howtoplaydialog.h"
#include "../common/gamenegotiationdata.h"
#include "gamenegotiationdialog.h"

class ShogiClient;

class MainWindow : public QMainWindow
{
    Q_OBJECT
public:
	MainWindow(QWidget * parent = 0);
	
	void paintEvent(QPaintEvent* event);
	// resizeEvent....
	void mousePressEvent(QMouseEvent* event);

public slots:
	void showStatusMessage(QString);
	void showStatusMessagePersistant(QString);
	void showStatusErrorMessage(QString);
	void debug(QString s);
	void connectToServer(); // Activated when button is pressed
	void gotConnectToServer();  // called when we get a connection
     
	void changeToState(GameState); // we receive the state we walked into, make changes!
	
	// Here are the slots for the actions in the filemenue
	bool startLocalServer();
	void showAbout();
	void showHowToPlay();
	void setUsername();
	void setPassword();
	void showGameNegotiationDialog(bool makesuggestion);
	void negotiationFinished();
	
private:
	Ui::MainWindow ui;
	
	ShogiClient* m_pClient;
	
	QString readUsername();
	QString readPassword();
		
	HowToPlayDialog* m_pHowToPlayDialog; // can be open all the time, so must be defined here or I have to learn howto execute another application (TODO)
	QSize m_rectSize; // the board has size m_rectSize *9
	
	GameConfiguration* m_pCurrentSuggestion;
	GameNegotiationDialog* m_pGameNegDialog;
};

#endif
